import threading
import time

"""
threading.Thread(group=, target=, name=, args=, kwargs=)

group: 暂时无用,未来功能的预留参数
target:执行的目标任务名
args：以元组的方式给执行任务传参
kwargs：以字典的方式给执行任务传参
name：线程名，一般不用设置

"""


def sing():
    while True:
        print("唱歌中")
        time.sleep(1)


def dance():
    while True:
        print("跳舞中")
        time.sleep(1)


def action(message):
    while True:
        print(f"我在循环的做{message}")
        time.sleep(1)


if __name__ == '__main__':
    # threading.Thread(target=dance).start()
    # threading.Thread(target=sing).start()
    threading.Thread(target=action, kwargs={"message": "饭"}).start()
    threading.Thread(target=action, args=("饭",)).start()
